Find Smallest and Largest element from list - Python Programming